<template>
  <div>
      <div  >
          <img class="container" src="../../assets/1.jpg" alt="" />
      </div>
    <div class="title">
      <span>志愿者</span>
      <span class="position">您现在的位置：志愿者</span>
    </div>
    <div class="search">
      <el-button type="primary" size="mini">搜索</el-button>
      <input type="text" value="职位" />
      职位
      <input type="text" value="工资待遇" />
      工资待遇
      <input type="text" value="负责人" />
      负责人
    </div>
    <ul class="mod-item">
      <li :key="index" v-for="(item, index) in list_Volunteer" @click="$router.push('/volunteerInfo/'+item.id)" >
        <img :src="item.picture" alt="" />
        <span>
          {{ item.total}}
        </span>
      </li>
    </ul>
    <div class="block">
      <el-pagination
        layout="prev, pager, next"
        :total="total"
        background
        :page-size="pageSize"
        @current-change="current"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list_Volunteer: [],
      pageNum: 1,
      pageSize: 4,
      total:3
    };
  },
  methods: {
    async getVolunteer(pageNum,pageSize) {
      let { data: res } = await this.$axios.get("/volunteer/getlist", {
        params: {
          pageNum,
          pageSize,
          
        },
      });
      this.total = res.data.total;
      this.list_Volunteer = res.data.list;
    },
    current(e) {
      this.pageNum = e;
      this.getVolunteer(e, this.pageSize);
    },
  },
  created(){
      this.getVolunteer(this.pageNum,this.pageSize)
  }
};
</script>
<style scoped lang="scss" >
input{
  padding: 4px;
  margin: 10px;
  box-shadow: 5px 5px 5px #ccc;
  border: 1px #fff solid;
}
.container{
    width:100%;
    height:500px;
}
.title {
  width: 80%;
  height: 30px;
  line-height: 30px;
  margin: 10px auto;
  border-left: 5px #999 solid;
  // border: 1px red solid;
  padding-left: 20px;
  .position {
    display: inline-block;
    margin-left: 20px;
    font-size: 10px;
    color: #999;
  }
}
.search {
  width: 80%;
  height: 30px;
  //  border: 1px red solid;
  margin: 10px auto;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
}
.mod-item {
  width: 80%;
//   border:1px red solid;
  margin: 20px auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  li {
    width: 49%;
    height: 130px;
    border: 1px #999 solid;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
     box-shadow: 10px 10px 5px #ccc;
    img {
      width: 100px;
      height: 100px;
      margin-left: 15px;
    }
    span {
        display: inline-block;
        width: 200px;
        height: 10px;
        margin: 0 auto;
        position: relative;
        top: -50px;
        left: 170px;
        font-size: 20px;
        color: #666;
      }
  }
}
.block{
    text-align: center;
}
</style>